package chapter10;

import java.util.Date;

public class Account {

	 private int id ;
	 private double balance ;
	 private double annualInterestRate = 0.0;
	 private Date dateCreated;
	 
	 public Account() {
		 this(0,0.0,0.0);
	 }
	 
	 public Account(int id, double balance,double rate){
		 this.id = id;
		 this.balance =balance;
		 this.annualInterestRate = rate;
		 this.dateCreated = new Date();
	 }
	 
	 public int getId(){
		 return id;
	 }
	 
	 public double getBalance(){
		 return balance;
	 }
	 
	 public double getAnnualInterestRate(){
		 return annualInterestRate;
	 }
	 
	 public double getMonthlyInterestRate(){
		 return annualInterestRate / 1200;
	 }
	 
	 public Date getDateCreated(){
		 return dateCreated;
	 }
	 
	 public void setId(int id){
		 this.id = id;
	 }
	 
	 public void setBalance(double balance){
		 this.balance = balance;
	 }
	 
	 public void setAnnualInterestRate(double rate){
		 this.annualInterestRate = rate;
	 }
	 
	 public void withDraw(double money){
		 balance -= money;
	 }
	 
	 public void deposit(double money){
		 balance += money;
	 }
	 
	 
	 
	 
	 
	 
	 
	 
	 
}
